// 业务组件
import MuSelect from '@/components/Survey/Materials/SelectComs/MuSelect';
// 编辑组件
import TitleEditor from '@/components/Survey/EditItems/TitleEditor';
import DescEditor from '@/components/Survey/EditItems/DescEditor';
import OptionEditor from '@/components/Survey/EditItems/OptionEditor';
import PositionEditor from '@/components/Survey/EditItems/PositionEditor';
import SizeEditor from '@/components/Survey/EditItems/SizeEditor';
import WeightEditor from '@/components/Survey/EditItems/WeightEditor';
import ItalicEditor from '@/components/Survey/EditItems/ItalicEditor';
import ColorEditor from '@/components/Survey/EditItems/ColorEditor';
import { v4 as uuidv4 } from 'uuid';
import { ComsTypeEnum } from '@/types';
import { memo } from 'react';

// 导出json-scheme配置，只有定义的配置项才能编辑
export default function () {
  return {
    type: MuSelect,
    name: ComsTypeEnum.muSelect,
    id: uuidv4(),
    // 组件状态：组件每一个能改的状态，都应该对应一个编辑组件
    status: {
      title: {
        id: uuidv4(),
        status: '多选题默认值',
        isShow: true,
        name: 'title-editor',
        //作为动态组件component使用无需响应式，使用markRaw/memo去掉响应式，可减少性能浪费
        editCom: memo(TitleEditor)
      },
      desc: {
        id: uuidv4(),
        status: '多选题默认描述',
        isShow: true,
        name: 'desc-editor',
        editCom: memo(DescEditor)
      },
      options: {
        id: uuidv4(),
        status: ['默认多选选项1', '默认多选选项2'],
        currentStatus: 0,
        isShow: true,
        name: 'options-editor',
        editCom: memo(OptionEditor)
      },
      position: {
        id: uuidv4(),
        currentStatus: 0,
        status: ['居左', '居中'],
        isShow: true,
        name: 'position-editor',
        editCom: memo(PositionEditor)
      },
      titleSize: {
        id: uuidv4(),
        currentStatus: 0,
        status: ['22', '20', '18'],
        isShow: true,
        name: 'size-editor',
        editCom: memo(SizeEditor)
      },
      descSize: {
        id: uuidv4(),
        currentStatus: 0,
        status: ['16', '14', '12'],
        isShow: true,
        name: 'size-editor',
        editCom: memo(SizeEditor)
      },
      titleWeight: {
        id: uuidv4(),
        currentStatus: 1,
        status: ['加粗', '正常'],
        isShow: true,
        name: 'weight-editor',
        editCom: memo(WeightEditor)
      },
      descWeight: {
        id: uuidv4(),
        currentStatus: 1,
        status: ['加粗', '正常'],
        isShow: true,
        name: 'weight-editor',
        editCom: memo(WeightEditor)
      },
      titleItalic: {
        id: uuidv4(),
        currentStatus: 1,
        status: ['斜体', '正常'],
        isShow: true,
        name: 'italic-editor',
        editCom: memo(ItalicEditor)
      },
      descItalic: {
        id: uuidv4(),
        currentStatus: 1,
        status: ['斜体', '正常'],
        isShow: true,
        name: 'italic-editor',
        editCom: memo(ItalicEditor)
      },
      titleColor: {
        id: uuidv4(),
        status: '#000000',
        isShow: true,
        name: 'color-editor',
        editCom: memo(ColorEditor)
      },
      descColor: {
        id: uuidv4(),
        status: '#909399',
        isShow: true,
        name: 'color-editor',
        editCom: memo(ColorEditor)
      }
    }
  };
}
